# Author：liyimei
# Time：2023/5/17 11:33
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait

driver = webdriver.Chrome()
driver.get('https://www.baidu.com')

kw = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, 'kw')))
print(kw.get_attribute('outerHTML'))

t1 = (By.ID, 'kw')
L1 = [By.ID, 'kw']
kw1 = driver.find_element(*t1)
kw2 = driver.find_element(*L1)

print(kw1.get_attribute('outerHTML'))
print(kw2.get_attribute('outerHTML'))
